package com.foreknow.demo5;

public class Ex1 {
    public static void main(String[] args) {
        int[] array = {18, 25, 7, 36, 13, 2, 89, 63};

        int maxValue = array[0];
        int maxIndex = 0;

        for (int i = 1; i < array.length; i++) {
            if (array[i] > maxValue) {
                maxValue = array[i];
                maxIndex = i;
            }
        }

        System.out.println("最大值是：" + maxValue + "，其下标是：" + maxIndex);
    }
}
